-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleaned up cucumber tests #114
Conversation
@@ -214,10 +220,6 @@ class ExtractorCallbacks{ | |||
return true; | |||
} | |||
|
|||
if ( w.direction == _Way::opposite ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this line to break oneway=-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're welcome to ignore/revert this change
Thanks a lot. One question though, could you move the ini files back to the root directory? |
sure no problem. i added the sandbox folder as a place for running osrm, downloading data, etc, but i'm happy to move it all back into the root folder |
This needs further documentation on how to get it run. |
ok. i'll try to write up something. anything particular that you miss? |
A wiki page on how to set up any depencies would be great. Some recipe to get the tests running. |
i could also update the brew formula to easily install everything on mac |
sure, I'll then add the steps to do so on Ubuntu. |
good idea with the wiki page |
I put up a wiki page with the basic information regarding the tests: https://github.com/DennisOSRM/Project-OSRM/wiki/Cucumber-Test-Suite |
thanks a lot |
I am getting the stuff to run on Linux right now. Is it possible to have cucumber create the test directory if it is not yet existing? |
yes, but the test folder should be in the repo, since the .stxxl file needs to be there |
the reason is that tests need an .stxxl config files with a minimal disk of 1MB, otherwise it takes too long to launch and terminate the binaries |
One odd thing is that cucumber does not properly shutdown the routed process before spawning a new one (at least on Ubuntu). |
the file feature/support/hooks.rb specified things to do before and after running each scenario |
the code is in https://github.com/emiltin/Project-OSRM/blob/cucumber_cleanup/features/support/launch.rb#L53 it uses the 'ps' system command, and searches for processes with the name 'osrm-routed', then sends it a signal 9 (KILL) |
I don't know the bevavior on Mac, but I guess that
lists all running processes of a user, right? On Linux it doesn't. So, I get the following output:
But checking with '-e' gives me:
|
from the manual:
guess we can just add that option? |
There must be something else. Adding -e or -A didn't help too much. In the end it also leaves a dangling osrm-routed process lying around. |
I am not really Ruby-literate, but this short script should output if it detects a running instance of osrm-routed, right? #!/usr/bin/ruby
def each_process name, &block
process_list = `ps -A -o pid -o state -o ucomm`
process_list.scan /(\d+)\s+([^\s]*)\s+(#{name})/ do |pid,state|
yield pid.to_i, state.strip if ['I','R','S','T'].include? state[0]
end
end
def find_pid name
each_process(name) { |pid,state| return pid.to_i }
return -1
end
print "started\n"
print "detected pid: " + find_pid("bash").to_s + "\n"
print "finished.\n" |
So, I played around a bit. On Linux the output of 'ps' is different to the output of Mac OS X. Could you give me a sample output of |
I am working on automated testing. A cronjob will be executing these tests. Results are then pushed onto the web. The URL is going to be http://project-osrm.org/cucumber.html Right now, most tests are failing because of the 'ps' issue, but this can be fixed. |
|
maybe you can post what the output is on linux? |
On Linux it is
Using the builtin Process class is perhaps the most portable way.
|
yeah Process might be the way forward |
another alternative: killall |
changed the code to use a ruby gem to fetch process list. note: you need to rerun 'bundle install' in the root folder, to get the sys-proctable gem installed. |
This gives better results, but still not perfect.
How many tests are supposed to fail right now? |
lets start simple. when i run "cucumber --tags @basic" i get: 7 scenarios (3 failed, 4 passed) as far as i can tell, these are legitimate failures, caused by odd osrm behaviour? |
you can also try "cucumber --tags @smallest". this runs a single, very simple test. this should pass without problems. |
7 scenarios (2 failed, 5 passed) |
|
or run a single test with "cucumber features/basic.feature:54". the first row of this one currently fails for me, returning bc, instead of ab,bc (Scenario: Two ways connected in a straight line) |
i moved one scenario out of the @basic scope, so i think we're now getting consistent results? |
note that test/fail.log will contain additional info about failing scenarios. |
I did not yet look at all the failing tests, but should they all run through? |
no they don't all run through... some could be due to incorrect tests of course. as i said, we just need to iron things out. we can perhaps look at one failing test and see what's going on. |
for example: Two ways connected in a straight line. |
perhaps we should use ab-bc instead of ab,bc. might avoid a few misunderstandings... |
I am close to preparing the final push to master repo. We should start changing, discussing failing tests afterwards. |
makes sense |
you might want to check on that thing with oneway=-1. as i said, you're welcome to revert/ignore that change if you want |
I ignored it ;-) |
good choice :-) |
i'm about to call it a day, but will be back tomorrow morning |
I'll keep on hacking on this for the coming two hours. The ambition to get it work kicked in. |
There's progress! |
nice!! later |
0ff2780 Release v2.5.4 3f1583a Remove workaround for MSVC missing constexpr support. 2a6c80b Rewrite expressions to avoid warnings on MSVC. 9b0602a Make two functions non-constexpr that can't be. ca1e501 Make NodeRef constructor, accessors and comparison ops constexpr. fb48312 Disable some problematic clang_tidy checks. d2d2812 Only do clang_tidy checks on files that are configured to be built. 5af55bb Always use braces after while() and if(). aebb6e3 No else after return. 65a3bf6 Better clang-tidy config. 3a965fa Add typedef Buffer::value_type needed when using std::back_inserter. c20ac26 Add lots of explicits to constructors. 1d12e09 Add clang-tidy make target. 052b1ee Add benchmark programs to files checked with cppcheck. 9ccbb49 Use only "final", not "override final". 0b9df1f User 'override' instead of 'virtual' in overridden functions. 1d0c1c6 Remove unnecessary get() call. 705391b Use consistent namespace closing comment. 25c1f38 Only use "final" on overridden methods, not "override". 8da2553 Setting CMAKE_EXPORT_COMPILE_COMMANDS works only after project() command. 5fec437 Use newest protozero library (v1.2.3). a3d759b Overloaded version of add_tag() with std::pair of strings. 1b4bcf9 Add function to add tag to tag list from existing tag. 7087e62 Update gdalcpp.hpp header to v1.1.1. 0008e8c Update change log. 39fe3a5 Add conversion and comparison operators to Timestamp. e6643a7 Update gdalcpp. 650280f Bugfix: Improved segment intersection function. 1b20597 Make operator bool explicit for (Typed)MemoryMapping. b580b25 Merge pull request #136 from tomhughes/ruby a7c6737 The multipolygon test only needs the ruby interpreter 4a0a9e7 Make conversion from Buffer to bool noexcept. 7cdabbe Set thread name in o5m input format. 6a17a8d Break out computation of thread pool size into function and test it. 1950853 Allow initializing a Timestamp from any integral type. 4103198 Fix link in change log. dc2ed89 Release v2.5.3 a2816b7 Fix end_of_time() Timestamp, add constructor taking std::string&. 3f5eb8e Updated changelog. 9b75c14 Cleanup and better docs for DiffObject and related classes. d0beead Better documentation for NodeRef and NodeRefList classes. 0192292 Cleanup/doc/test osmium::util::Options. b3db055 Use header with forward declarations. 8b3fe16 Improved documentation. cd2ce38 Remove unused typedef Buffer::value_type. 87c9b32 Cleanup and test Buffer::add_buffer() function. e519278 Improved documentation for osmium::memory::Buffer. d721d43 Deprecate set_full_callback(). Better doc for deprecated functions. 58b5fd1 Remove DataFile class which was never used anywhere. 30b806e Simplify some tests. 62958df Update change log. a8a2e68 Merge pull request #134 from zerebubuth/buffer-size-checks 987faab Move some code belonging into there into relations::Collector. da31175 When the buffer isn't big enough, even when empty, to reserve the space that's being requested then it shouldn't reserve it anyway. 5d2f949 Swap the growth flag and any "full" callback as well as all the other members when swapping this buffer object. 1845aa9 The assertions prior to dereference are more strict than the conversion to bool. However, conversion to bool is often used as a predicate for whether dereference is okay, so the behaviour is easier to understand if they match. abdfee1 Remove unused m_want_types in relations collector. 95b387f "Officially" mark two constructors as deprecated. 1d0da5f Release v2.5.2 31c3eaf Copy iterator around less often. 83c93d0 Do not check the write_future for exceptions on every item. 1c805ea Add counting of push() calls on queue in debug mode. aa869c0 Release v2.5.1 212578b Fix documentation of Writer constructor. 0445dd8 Add new header file with forward declarations of commonly used classes. 4b6baac Optionally include external library headers. 712a6d1 Update change log. fc78d04 Update style rules. b590fe3 Unify use of 'typename' in templates. Unify spacing of ellipsis operator. 8c450ac Move osmium/io/overwrite.hpp to writer_options.hpp. 08eed02 Move DEPRECATED macro into compatibility.hpp. b72eb8d Release v2.5.0 5aeba6b Better formatting for invalid timestamps on debug output. 6772413 Add valid() function on Timestamp. 7549b05 Update change log. 84119b0 Add option to fsync files after they are written. db1bd92 Make optional parameters on Writer work in any order. 3482e3e Remove boilerplate. Add explicits to constructors. cf389c6 Rename the wrap() function to the better ensure_cleanup(). 678049e Use reference instead of pointer for decompressor. 7189d28 More consistent use and naming of Function templates. 3d66deb Use const& for parameter that's not changed. 88d65fb Fix warning with a cast. 03e8c9f Fix some misc issues found by cppcheck. 4848676 Options to cppcheck to check everything (--force) and ignore assert. 5f89a8c Add lots of assert() calls to Buffer implementation. c990b43 Use a wrapper function in Writer for error handling. 04d9e3e Refactor of writer to work properly in all error cases. 6daf2d3 Throw when reading from Reader after eof or error. Use io_error everywhere. 713a189 Rename OutputFormat::close() to write_end(). 7905add Refactor Reader/Writer code. c050a05 Make thread_handler class movable. 8e661a2 Make DeltaEncode/Decode more generic and fix signedness issues. da712a9 Fixed a few signedness issues. dc04e67 Avoid possible narrowing conversion. abd44af Make a variable static that should be. 7039fa6 Avoid global variable. 9e9fc0f Add a noreturn attribute. a681a2c Do not pass Timestamp class through forwarding. d37b717 Clean up status handling in Reader and Writer. 3b1f0d8 Add at_end_of_data() helper function to get self-documenting code. bf3cc8c Add add_end_of_data_to_queue() helper function. 94bdd09 Fix test. 531db80 Use valid() on future instead of an extra bool. 7f328b3 Make RVO work for pop() function. c1d726d Add some static_cast_with_assert paranoia checks. 5a064f7 Make sure DeltaDecode/DeltaEncode classes work for all integer types. c69a701 Fix some integer types. 2b2cfc9 Remove extra semicolons at end of function definitions. 2b74aa6 Use workaround for GCC unused variable warning for index::map, too. f7fb94d Different way of supression unused-variable warning. c0813e6 Better handling of threads. 963ff8e Move internal buffer from OutputIterator into Writer. 698d027 Update change log. 24270dd Remove unused variables. 64d6363 Remove unnecessarily fully-qualified name. 5ccacc7 Add support for reading o5m and o5c files. b603904 Fix up includes. 6013a27 Remove pessimizing move. a19e4cf Use queue_wrapper in Reader, too. 74a5174 Refactor thread creation for WriteThread. c480b33 Fix test code. e135597 Do not use promise in two threads at once. 6fa16ca Refactor input format code. 53fc576 More robust implementation of writer/writer_thread. 1285316 Put some queue handling into new wrapper class. a1e6e6f Rename osmium/io/detail/util.hpp to queue_util.hpp. f42d6fc New add_to_queue() helper functions. 3db9b49 Simplify read thread handling. a903561 Move any exception in read thread through queue. ee977cb Add more tests for reader code. 99aaa45 Factor out input handling in classes derived from Parser. 7afa03c Wrap access to m_read_types in InputFormat. f6c5971 Wrap sending to output queue in InputFormat. 26f4170 Consolidate header handling in InputFormat. a0aa3ed Remove unnecessary inline declaration. 894e84a Declare a bunch of destructors noexcept and use consistent comments. 6c49b43 Add hack to append_printf_formatted_string() so it works on Windows. 20c3f20 Remove a move that prevented copy elision. 8192a4c Pull low-level string formatting out of debug output and test it. 190aa46 Move low-level string formatting/encoding functions into own header. 3e35441 Add Option::is_not_false() helper, use and test it. 0a90339 Updated some comments. a44066f Make naming of output format options more consistent and document them. a59b60b Run serialization of PBF blobs in worker threads speeding up PBF writer. 18a739f Remove unused m_file attribute from OutputFormat class. 9b5d3b7 Various output option related cleanups. 36772a0 Consistent ordering of methods in *InputFormat classes. c04a51f Factor out common code in output formats. ebc53d4 Do not use "explicit" on constructors with more than one argument. e1dfcfc Make all destructors in io/detail noexcept. cfd7970 Use consistent handling of output options in all outputs. c4e71f0 Better implementation for output_formatted() and tests for it. 899a061 Extract common code from output formats. b226ae4 Factor out common code from *OutputBlock classes. fe4b287 Cleanup WriteThread class. af421df Consistent naming of queue typedefs. e8253c4 Add missing include. 9f71cd3 Refactor management of read thread into its own class. 4c96e16 Refactor Reader/InputFormat. fa02e6c Refactor input format code. d14ea27 Extract common code from PBF/XMLParser into new Parser class. fe7acd3 Better handling of failures when parsing header. 2e3b6cd Remove unnecessary include of <future>. 3bd18b8 Factor out common code in input format. 2915604 Only get promise and future once, even if header() is called multiple times. cfc980c Make output buffer for XML parser smaller. 4c1ffa7 Orderly shutdown in io::Reader. 8c7aa32 Remember whether the input queue was exhausted. 535bb6a Function call in new thread can be void. e0d5448 Factor out some helper function for queue cleanup. 5a4c6b5 Use std::thread directly for input instead of std::async. c1bdf4f Move common code from InputFormat child classed into base class. 89caa6e Report failures in input_format through the queue. 8f4d300 Rename (m_)queue to (m_)output_queue. 8fc1f5b Reorder XMLParser class making check_attributes() private. df381d7 Make sure we always send end-of-file from PBF parser. 1a178b0 Factor out construction of PBFDataBlobDecoder. cb34f76 Factor out read_from_input_queue_with_check() method. 21b51cc Factor out parse_data_blobs() method. dc957a8 Make some variables const. 1c2812c Make methods private that don't need to be public. 81e5625 Refactor out parse_header_blob() function. f9e5760 Fix test: New signature of XMLParser constructor. 43746d3 Add copy constructor to PBFParser. 8524780 Rename variables and other changes for clarity. 3e9627b Removed now superfluous parameters from InputFormat class. 7eac5cf Simplify input format class. 3ea2ace Set max queue size only in one place. 77ab086 Formatting. ceee837 Use std::async instead of "raw" std::thread for pbf input. 6cafb45 Move and rename PromiseKeeper class: Now in thread/util.hpp. 06eff29 Set thread name for xml parser thread. bd485cd Refactoring of threading code for input. fc03bf6 Make sure (de)compression classes clean up properly. 27af4ea Use special function to shut down pool workers instead of an atomic<bool>. 84297b3 Bugfix: auto and std::minmax() don't mix well. 597ecc4 Always use std::swap() in the idiomatic form. 10dd14f Remove threading test that fails when machine is too busy. 2072786 Use reserve() to spead up dumping indexes. 66a344b Declare some index functions noexcept, especially destructors. a0586da Use map::find() instead of awkward try-catch block. d38a7f1 Do not run make tasks in parallel. cd33daa Do not use clever YAML aliases, instead copy dependencies explicitely 4ad6e43 Integrate more compiler and os versions b2c519b Check return code of close() system call and throw. 369057b Update protozero to current 1.2.2. d1db14b Collect debug output options into struct. 54667dd More consistent debug output of way nodes, relation members and changeset comments. 67e1513 Add some paranoia checks to xml parser. 69de191 Refactoring in xml reader: New function check_attributes(). c67f3f3 Add support for changeset discussions (comments). 9c5531c Merge pull request #121 from DerDakon/cmake-find-no-components 44be1a7 Add helper functions to make input iterator ranges and output iterators. 76e2b91 Merge pull request #130 from alex85k/master 5a4fa6b remove assertion messageboxes in tests on Windows bac5a77 Updated change log. 7e7bba4 Updated included protozero library to 1.2.0. 1ae370d Merge pull request #122 from zerebubuth/pbf-decode-non-visible-node-locations 5897468 Merge branch 'master' of github.com:osmcode/libosmium 7f2de1b Bugfix: Delta iterator handling. 65d31e9 Try ; as cmake list separator. 3a9dbc2 Add PBF libraries, now that the test reads PBF too. Thanks @tomhughes for pointing this out. 9a22ea1 Add test case for reading deleted / non-visible nodes in history files. 36098a8 Decode lat/lon even for non-visible nodes. 8279fd1 kick off AppVeyor to test new binary deps package with gdal200 c8244f7 FindOsmium: prevent errors in list(REMOVE_DUPLICATES) when no components are requested a02806a Use https URL to travis. a1b7015 Fix some includes. 468e4d8 Remove pessimizing std::move. 427d2e0 Do iwyu check on header files in alphabetical order. be9a996 Release v2.4.1 95a3bc8 Fixed CRC calculation of tags and changesets. 4e157e3 Release v2.4.0 3da68f0 Fixed setting of binary mode on Windows. 81aa057 Use binary mode for memory mapped file on Windows. 986cb7e Set stdout to binary mode on windows before writing to files. 27d02eb Bugfix: Do not dereference end iterator. e96eeaf Updated change log. 64a55ce FindOsmium: let FPHSA handle all the additionally required things e152057 FindOsmium: pass the proper module name to FPHSA a4acce3 Remove restriction on master branch in appveyor config. 10c8265 FindOsmium: simplify the fallback code for sparsetable::size_type 190ed47 remove the correct include dir from OSMIUM_INCLUDE_DIRS aaa99c1 avoid that FindOsmium finds a random include dir 6406010 Add a magic define fixing a boost problem. 2fa6674 Remove superfluous file paths from cmake config. e081a51 Merge pull request #114 from DerDakon/do-not-cache-version 20e1a24 Use external gdalcpp wrapper for compatibility with GDAL 2. 3b7cc86 Fix initialization order in DeltaEncodeIterator. 0954b0f Fix possibly uninitialized variable. f081942 Take byte swap functions out of CRC class. e085aae Fix byte swap, add test cases for crc. e648b62 Merge pull request #116 from DerDakon/yml-simplify 7912897 properly put bzip2 library in the CMake cache e0ea72b use less variables when defining the test environment cf8ff6c do not cache the version string 38234cd Remove pragmas disabling warnings from gdal includes. 82d8c30 Include headers of external libraries as "system libraries". f721b86 Update protozero to version 1.1.0. a29ef82 Add some magic to enable folding on travis output. 18b2418 Removed toogr examples. They are in their own repository now. 89c8220 AppVeyor: 1st try with VS2015 93a1626 Added recent changes to change log. ce4b45e Bugfix: Program hanging when opening unknown file type. 06ad6ef Rename add_string() to store_in_stringtable() and use right return type. 869058d Add explicit conversion that always works. 0b28f2c Add missing check in TagListBuilder add_tag() overload. 51fa9c0 Check in builder that key/value of a tag is not too long. 9b1da20 Check that string table isn't overflowing. 2c732c6 Add some extra paranoia checks and type conversions to pbf writer. f92096a Fix integer size. a47ddb4 Force conversion to smaller int type, because we know it must fit. f150ff1 Rename variable that was hiding parameter name. ab92064 Use correct size_t as return type. 2f2bf68 Check that roles are no longer than max allowed string length. 4a7df68 Check strings for max length in PBF input. e4b8bb0 Explicit conversion to bool. d18352d Make conversion from double to integer explicit. git-subtree-dir: third_party/libosmium git-subtree-split: 0ff278001f6e0bc79040add736452bef3aa4ff06
a2a485834 Update CHANGELOG 82f95612e Merge pull request #180 from mapbox/lightmare-move-out c0e7ac6fd Merge pull request #181 from lightmare/revive-result-type d13e61784 Revert "visitor - revive using explicit return type when provided" 0ebf09dea revive using visitor::result_type when available b1076bbee visitor - revive using explicit return type when provided 2e3947578 properly forward through variant::visit b09c7e121 travis: force compiling all tests 0ce49d837 add test case for issue #180 discovered by @artemp 8fc03c4d9 Remove clang 3.7 and gcc47 builds f6e57e9c2 Merge branch 'move-out' of https://github.com/lightmare/variant into lightmare-move-out 94c8ccf54 fix expected compilation error messages 6d21f7704 perfect forwarding in apply_visitor d960916fc implement match on rvalue 8b9eeb238 test matching unwrapped rvalue with lambda expression 77a24b9c0 Merge remote-tracking branch 'upstream/move-out' into move-out 4ce01e1c2 clang - self-assignment is a compile time error c94634bbd Merge pull request #172 from mapbox/self-assignment 3dcac646f updated move assignment as suggested in mapbox/variant#172 (comment) b36c78e12 Just use `assert(this!=&other)` in move assignment operator (https://stackoverflow.com/questions/9322174/move-assignment-operator-and-if-this-rhs) 767bc18f3 Improve self-assignment/move checks to have one return path. 94fc9377e Revert "disable -Wself-assign-overloaded (-Werror) in self-assignment test" da2b171b7 Revert "don't fail old compilers" 7918a4847 don't fail old compilers ad85832b8 disable -Wself-assign-overloaded (-Werror) in self-assignment test 4da455725 add self-assignment checks in copy and move assignment operator= (ref #164) cb02ad487 update CHANGELOG for variant v1.1.6 release [skip ci] a4f87dc69 fix version number ff14f222a update CHANGELOG 0305fdb2a Merge pull request #171 from mapbox/jrex-mute-clang-analyzer 2fef61f08 Moved to in-class initialization 52df2765e update CHANGELOG in preparation for v1.1.6 release 63854e5c9 Add explicit initialization of data to mute clang static analyzer warnings in Xcode (10.2). 0f734f01e Merge pull request #167 from mapbox/clang++4 5a5ecca5b Run ASAN builda in isolated VM via `sudo : required` c1a14e7d9 update mason + update clang++ to 4.0.1 fe0a0666f update mason 11a36a9f1 steady .. downgrade clang++ to 4.0.0 f31bcfb4b try fixing travis via upgrading clang++ from 3.9.1 -> 4.0.1 502e32b8b fix Makefile a64062576 use `ls -lah` as `du -h --apparent-size` is not universally supported. ef3856c85 report actual file size not allocated size. 256ddd555 Merge pull request #160 from mlogan/master 9c81bef8c Fix the noexcept specifications for move assignment and conversion. 5eee328d6 Merge pull request #165 from nick70/master 0888a8e92 Fix README.md issues 859a8c933 Merge pull request #163 from MaxRis/master 215d64585 Removes deprecated static_visitor to avoid msvc C4996 compiler warning 237f83cad Merge pull request #162 from mapbox/variant_alternative 835ebc193 add `variant_size` helper 30560e19e fix preprocessor logic 8b1de3147 add compile index in range check for __type_pack_element branch. ae1931413 add optimized 'variant_alternative' implementation usinh built-in `__type_pack_element` when available (clang++) 3ffef950b add `variant_alternative_t` 3449d00cf alternative implementation of `variant_alternative` 4b98c485c add lost test check + remove stderr 43357808c add intial `variant_alternative` implementation (#161 http://en.cppreference.com/w/cpp/utility/variant/variant_alternative) ba3085a5e use full sha1 75bb549d2 update CHANGELOG (git log <tag1>...<tag2> --pretty=format:'* %s [view commit](http://github.com/mapbox/variant/commit/%H)' --reverse) 6497bce68 add <sha1> to CHANGELOG entries. 555436f71 add CHANGELOG.md skeleton b78b51548 Merge pull request #154 from ricardocosme/forwarding_reference_make_visitor f0b50062b Add copy assignment and move assignment operators. 9f991da78 Use forwarding reference in make_visitor and visitor 266f68d9f Merge pull request #153 from ricardocosme/boost-build 04a6797a6 - Add auxiliar rule exe-test. bd0a2d559 - Use of the module 'os' to get BOOST_DIR. - Add macro SINGLE_THREADED to single threading mode. - Define single threading mode as default. - Add lambda_overload_test and hashable_test. 561a09dd0 - Remove the use of boost libraries. - Add default build. b2471ffc7 - Add a project mapbox_variant. - Use of the 'os' module to capture CXX_STD. - Common configs moved to project. - Built targets moved to 'out' directory. 624720759 add test for ref #147 + mapbox/variant#147 e01b7bf33 Merge branch 'BlueSolei-master' 195367cfc Merge branch 'master' of https://github.com/BlueSolei/variant into BlueSolei-master ea106db54 recursive_wrapper test - avoid constructing new functor in recursive calls, call itself via `this` pointer. 7a541ba10 recursive_wrapper fail to compile when used with 2 classes which are base and derived #146 291121f6a Merge pull request #144 from narizhny/Casts 51fccd755 Add static_variant_cast, dynamic_variant_cast 550ac2f15 Merge pull request #143 from tomhughes/catch a064940e2 REQUIRE_THROWS etc take an expression not a block f9c265d7e Update bundled Catch to v1.9.0 5778eede1 Fixes example: rvalue variant matching cdb9faf0f Simplifies result_of_* and let them handle rvalue refs c5dac859a Failing Test Case: std::move-ing out of variant 916139a2e Merge pull request #141 from mapbox/match-otherwise 3d807d316 Merge pull request #138 from mapbox/sizeof 9ac8978f5 Adds a test for polymorphic lambdas in match, resolves #140 c839c666c add missing <limits> 35487cd39 Make `type_index_t` configurable at compile time via `MAPBOX_VARIANT_MINIMIZE_SIZE` and `MAPBOX_VARIANT_OPTIMIZE_FOR_SPEED`. Default is `unsigned int`. (ref #138) 3f6fd131e Add compile time check to disallow array types as alternatives. fa8e124a2 Ensure internal index type is capable of holding all alternatives (ref #138) 05ee9aca1 use `mapbox::util::type_index_t` (#19) 9eec1fd48 make type used for `type_index` configurable via `type_index_t` typdef + use `unsigned int` by default. This addresses `sizeof` discrepancies between boost/std/mapbox variants (ref #19) d2588a8f1 Trivial missing comma in README example code 05b7612aa Merge pull request #135 from mapbox/llvm-3.9.1 61f8acea1 upgrade mason f5fb4661e upgrade to llvm 3.9.1 5baa948fa fix gyp build 4923eb527 osx: test that will support both latest (10.12) and oldest with c++11 support: 10.7 18a8055fe Merge pull request #134 from lightmare/warnings 5141d8d21 remove useless and/or dubious compiler flags a9707c3de Merge pull request #133 from mapbox/Werror a80beaafc disable -Wparentheses for older gcc c8ec829ff drop -Wstack-protector which gives unhelpful warnings 7b409402c upgrade libstdc++ for coverage build b43398619 Add -pthread 904dcaee6 limit some flags to clang++ 1023f2d9a try without pthreads 886377de0 fortification flags + -pthreads for linux where needed cf9a53499 build in both release and debug on travis 539d71274 fix conversion warnings 253047f53 enable -Werror, suppress warnings from non variant headers using isystem 18919174d Merge pull request #132 from lightmare/avoid-tuple-instantiation 4febf973c avoid expensive instantiation of tuple constructor in noexcept 6317a0b74 re-enable older compilers, trim excess 4fe5ced5d more sanitizer options d1bb6e546 -fsanitize=cfi and -fsanitize=safe-stack 20d693ed9 fix LDFLAGS 9b2de4546 test with clang++ sanitizers and flto 702826365 disable clang++ 3.9, will work on getting working in a branch e07a533a8 fix clang++ PATH 84eeb54c9 test clang++ via mason a760cea8d upgrade mason b9c58d631 upgrade boost to 1.62.0 c81b475b4 makefile improvements ce2eea644 travis: fix addons efa75df27 test with clang 3.9 and g++-6 cb5635ba2 add package.json for publishing to npm 02bd1ac4c Merge pull request #129 from daniel-j-h/docs ed84def12 Merge pull request #128 from daniel-j-h/match 3c17c37ae Merge pull request #126 from daniel-j-h/hashable d0266436b Adds Documentation for Readme, resolves #98 720c23736 Implements Pattern Matching for Sum Types via `.match` Member Function. 97d0379f0 Makes variant<Ts...> hashable iff Ts... are hashable, closes #125 9a115c5eb Merge branch 'daniel-j-h-lambda-visitor' 4d462f27b Adds C++14 SFINAE Test 2275a6197 Removes ::type Usage d09188640 Provides Convenient Lambda Overload Visitor Interface, resolves #113. a5a79a594 Fix #122 by adding an extra compile check in universal ctor (via @lightmare) + test case 9b46167f5 nicer stderr 84a426a31 Merge pull request #120 from mapbox/types 173a74579 add `struct adapted_variant_tag;` e5818212a expose `using types = std::tuple<Types...>;` - useful for adapting variant to `boost::spirit` (QI,Karma,X3) aaddee927 Update README 8e2f69641 Merge pull request #116 from lightmare/disjunction 2c7ddecdb use C++17 disjunction for no-references and one-convertible tests 388376ac9 Merge pull request #114 from mapbox/strict-conversions 075d9636f comment out code 8be6a2aa8 update tests 71ac8fdf9 Re-implement type matching logic to reject ambigious conversions c511b2f34 add test for b3a002d185afac295486e2ebd6b84c78a2267ba0 (ref #112) b3a002d18 fix value_traits to be able to match T, T& and T const& to the direct type stored in variant (ref #112) b5728ad76 update .mason pkgs eedafd31f use local HAS_EXCEPTIONS #define (__EXCEPTIONS is g++/clang specific macro) 372d7c88f c++ apply formatting 20e44accb Merge pull request #110 from mapbox/110-get_unchecked 37acc5a7c uncomment tests ref #82 adf0e02bc variant - yield return type of mapbox::util::get<T> automatically and make interface consistent (addresses #82) bb8c2d203 Merge branch '111-which-constexpr' dca3d967c Merge branch 'master' into 111-which-constexpr 74ce146d9 add static which<T>() function to get a contained types' which value 48d60445c remove unused internal metafunctions 434dab048 Add get_unchecked<T>() to enable use with exceptions disabled 2f8a4a381 Merge pull request #109 from mapbox/darwin-build-flags 33e27ec4c Update README.md 55579f03f Fix building with GCC (g++-5.2.0) on OS X (Darwin) (ref #108) 8bdad6b6d Update README.md 7f7470fee Jamroot - add missing include directory ./test/include for auto_cpu_timer.hpp 4368d7529 remove expected error string - current implementation emits compiler specific error message e.g c6ae1ea0a `is<T>()` - add specialisation for recursive_wrapper<T> + update tests (ref #102) 04dc3a46b Install boost with mason; eliminate boost::timer dependency 9b2fc858c Remove Xcode 6 from CI matrix 1bc46e525 Merge pull request #101 from mapbox/include 390229a59 fix compilation bfe0f19dd update remaining `<variant.hpp>` to `<mapbox/variant.hpp>` 343831611 ammend include dir a606e9024 fix typo 9bd902536 Merge branch 'master' into include 7e4a01189 Add include directory 13c631a62 Update README.md f00b24bf6 move headers into include/mapbox folder - closes #99 35ca16c74 issue warning `-Wweak-vtables` so this issue is not forgotten (mapbox/variant#95) 82bb901b6 run coverage with clang 3.5 - fix clang 3.8 build 5f6ed7149 remove invalid option for llvm-cov f034d5571 fix clang 3.8 compile, try 3.9 b0ee4729b fix coverage to avoid warning: unit.gcno:version '402*', prefer '406*' 3f025adbf remove erroneous `;` ref #96 git-subtree-dir: third_party/variant git-subtree-split: a2a4858345423a760eca300ec42acad1ad123aa3
here's a cleaned up version of cucumber tests - single commit rebased on your master.
it's quite a big chunk with many pieces, so take a look, and hopefully we can iron out any issues, so it can become a help in finding and fixing bugs.
Prerequisites:
ruby: should be preinstalled on most systems.
gems: cucumber, rake, osmlib-base. the easiest and safest is to first install the 'bundler' gem, then run 'bundle install' from the project folder.
osmosis: command line tool for converting and cropping osm files. if you're on mac you can install it via homebrew with 'brew install osmosis'
if you don't want to run tests, you should still be able to build and run osrm without installing any of the above.
SConstruct:
the SConstruct file had to rearranged a bit to get os x compilation to work. other platforms should not be affected, but i couldn't test it on those other platforms. compilation on mac does not currently use openmp.
Files:
test are located in features/ and organized into feature files, each containing scenarios.
test and sandbox are now two separate folders. test is where all the tests are run. sandbox is where you can use rake task to download real osm data, run the server manually to test in a browser, etc.
speedprofile.ini has been split into separate files, stored in speedprofiles/
both test/ and sandbox/ folder contains a .stxxl config file. the one in the test folder uses a 1MB disk, the one in sandbox uses a 1GB disk.
Mechanics:
for each test scenario, an osm data file is constructed based on the description in the test scenario. the osm file is converted to protobuffer and preprocessed with osrm-extract and osrm-prepare.
the resulting osrm files are cached, so that processing is only repeated if either the osm data, the speedprofile or the binaries have changed. this helps speed up the running of tests a lot.
test/server.ini and test/speedprofile.ini is now rewritten to ensure that the right data files are used.
osrm-routed is then launched, and routes are requested via http calls to port 5000 on localhost, and the response is compared to the expected result.
all request are timed out after 5 seconds. both timeouts and crashes are caught and reported.
to ensure a clean run of every test, all processes named osrm-extract, osrm-prepare and osrm-routed are killed before and after each test using a signal 9, no matter who launched them. i have only tested this on mac os x 10.7. it should work on linux, but process management can often behave differently depending on platform. test are not yet expected to work on windows, for example the unix shell command 'ps' is used. i assume there will be other issue too, but if course it should be possible to get it working.
Writing tests:
tests come in two main flavors. one where you specify data and test routes separately, and one where you just provide a table of ways and their tags to be tests.
with the first type, you setup the data by a small 'node map', and a list of ways (and optionally relations). finally you specify a list of start/end pairs, and the expected route, described by the ways traversed:
by default, tests use the bicycle speedprofile, but this can be changed for each scenario by adding:
you can also modify the speedprofile by using:
note that 'Given' and 'And' is interchangeable in cucumber, you should just use what creates a natural language flow.
the second flavour of tests simply lists ways and their tags:
an osm file is constructed, containing an isolated way for each row. columns are converted to tags. forw and backw has special meaning; if an forw column is present the way is tested for forward routability. if an backw row is present, it's tested for backwards routability.
nodes are spaced on grid with origin at 1,1 and a grid size of 100m
Running tests:
You can run all tests, or specific sets or scenarios.
to run all test: cucumber (or 'rake test')
to run test with a specific tag, use: cucumber --tags @restrictions
to run a specific scenario: cucumber features/restrictions.feature:6
routes are valided by parsing the instructions hash. osrm currently often return empty routes, which is one of the main reasons a lot of test are currently failing.
during test, several log files are used. output from osrm-extract and osrm-prepare are directed to test/preprocess.log. output from osrm-routed is directed to test/osrm-routed.log.
tests results are shown in the terminal. green rows indicates a passed route. yellow is an expected, but missing, result, while grey is an unexpected result.
there's an issue with the order failing rows are displayed, which can be somewhat confusing - the failing row is not directly beneauth the expected row.
additional info is logged to fail.log, containing details about the osm data used, the speedprofile, expected and returned routes, as well as actual query and response involved.
there's currently a lot of failing tests. i'm sure some are caused by incorrect test cases or bugs in the cucumber setup. we just need to iron things out.
Rake task:
a few useful rake task are included. you can run 'rake -T' to get a list of rake commands.
for example, you can run 'rake download ' to download and crop osm data into your sandbox folder. curently only a few fixed areas work, including:
kbh: openhagen
dk: denmark
after downloading, you can run 'rake process' to process the downloaded data.
to run your server in the terminal, use 'rake run'. you must download and process data beforehand.
you can also run the server in the background with 'rake up' and 'rake down'. output is directed to osrm-routed.log. again you must download and process data beforehand. note however, that the include index.html file doesn't point to localhost, which is what you need to use the server you run locally.